<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>01-组件基本事例demo01</title>
</head>
<body>
  <div id="app">
    <handle-click></handle-click>
    <blog-post title='111'></blog-post>
    <blog-post title="222"></blog-post>
    <blog-post title="333"></blog-post>
    <alert-box>
      Something bad happened
    </alert-box>
  </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
  Vue.component('handle-click',{
    template:`<button @click='count++'> you can click me {{count}} times</button>`,
    data(){
      return{
        count:0
      }
    }
  });
  Vue.component('blog-post',{
    props: ['title'],
    template:`<h3>{{title}}</h3>`
  });
  Vue.component('alert-box',{
    template:`
    <div>
      <slot></slot>
    </div>
      
    `
  })
  new Vue({
    el:'#app'
  })
</script>
</html>